package com.publishproject.test;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;

import com.android_base.core.views.bindingViews.BindingListView;
import com.publishproject.ListAdapter;
import com.publishproject.R;

public class BindinNestedNetViewActivity extends Activity {

    private BindingListView listview;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bindin_nested_net_view);
        listview = (BindingListView)findViewById(R.id.list);
        listview.setAdapter(new ListAdapter(this,listview.getmList()));

        listview.bindList(null);
        listview.notifyObserverDataChanged();
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                listview.getmList().add("232323");
                listview.getmList().add("232323");
                listview.getmList().add("232323");
                listview.getmList().add("232323");
                listview.getmList().add("232323");
                listview.getmList().add("232323");
                listview.getmList().add("232323");
                listview.getmList().add("232323");
                listview.getmList().add("232323");
                listview.getmList().add("232323");
                listview.getmList().add("232323");
                listview.notifyObserverDataChanged();
            }
        },3000);
        listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                Log.i("TAg","点击了positio:"+position+"  id:"+id);
            }
        });
    }
}
